package net.oschina.bilbodai.common.beanutil.bean.builder;

import net.oschina.bilbodai.common.beanutil.bean.AttrPathQueryInfo;
import net.oschina.bilbodai.common.beanutil.bean.core.PropertyDumpInfo;

import java.lang.reflect.Field;

public class PropertyDumpInfoBuilder {
    private String idName;
    private String profile;
    private String srcOwnerInternalName;
    private String targetOwnerInternalName;
    private boolean dumpOverride;
    private AttrPathQueryInfo attrPathQueryInfo;
    private Field srcField;
    private Field targetField;
    private String srcFieldInternalName;
    private String targetFieldInternalName;
    private String srcGetterName;
    private String targetGetterName;
    private String srcSetterName;
    private String targetSetterName;
    private String srcGetterDescriptor;
    private String targetGetterDescriptor;
    private String srcSetterDescriptor;
    private String targetSetterDescriptor;
    private Class<?> collectTypeImpl;
    private Class<?> srcKeyType;
    private Class<?> srcComponentType;
    private Class<?> targetKeyType;
    private Class<?> targetComponentType;
    private String mapFieldOwnerInternalName;
    private String mapFieldInternalName;
    private String mapFieldGetterName;
    private String mapFieldGetterDescriptor;
    private boolean sorted;

    public PropertyDumpInfoBuilder setProfile(String profile) {
        this.profile = profile;
        return this;
    }

    public PropertyDumpInfoBuilder setSorted(boolean sorted) {
        this.sorted = sorted;
        return this;
    }

    public void setMapFieldInternalName(String mapFieldInternalName) {
        this.mapFieldInternalName = mapFieldInternalName;
    }

    public void setMapFieldOwnerInternalName(String mapFieldOwnerInternalName) {
        this.mapFieldOwnerInternalName = mapFieldOwnerInternalName;
    }

    public void setMapFieldGetterName(String mapFieldGetterName) {
        this.mapFieldGetterName = mapFieldGetterName;
    }

    public void setMapFieldGetterDescriptor(String mapFieldGetterDescriptor) {
        this.mapFieldGetterDescriptor = mapFieldGetterDescriptor;
    }

    public void setSrcOwnerInternalName(String srcOwnerInternalName) {
        this.srcOwnerInternalName = srcOwnerInternalName;
    }

    public void setTargetOwnerInternalName(String targetOwnerInternalName) {
        this.targetOwnerInternalName = targetOwnerInternalName;
    }

    public PropertyDumpInfoBuilder setIdName(String idName) {
        this.idName = idName;
        return this;
    }

    public PropertyDumpInfoBuilder setDumpOverride(boolean dumpOverride) {
        this.dumpOverride = dumpOverride;
        return this;
    }

    public PropertyDumpInfoBuilder setAttrPathQueryInfo(AttrPathQueryInfo attrPathQueryInfo) {
        this.attrPathQueryInfo = attrPathQueryInfo;
        return this;
    }

    public PropertyDumpInfoBuilder setSrcField(Field srcField) {
        this.srcField = srcField;
        return this;
    }

    public PropertyDumpInfoBuilder setTargetField(Field targetField) {
        this.targetField = targetField;
        return this;
    }

    public PropertyDumpInfoBuilder setSrcFieldInternalName(String srcFieldInternalName) {
        this.srcFieldInternalName = srcFieldInternalName;
        return this;
    }

    public PropertyDumpInfoBuilder setTargetFieldInternalName(String targetFieldInternalName) {
        this.targetFieldInternalName = targetFieldInternalName;
        return this;
    }

    public PropertyDumpInfoBuilder setSrcGetterName(String srcGetterName) {
        this.srcGetterName = srcGetterName;
        return this;
    }

    public PropertyDumpInfoBuilder setTargetGetterName(String targetGetterName) {
        this.targetGetterName = targetGetterName;
        return this;
    }

    public PropertyDumpInfoBuilder setSrcSetterName(String srcSetterName) {
        this.srcSetterName = srcSetterName;
        return this;
    }

    public PropertyDumpInfoBuilder setTargetSetterName(String targetSetterName) {
        this.targetSetterName = targetSetterName;
        return this;
    }

    public PropertyDumpInfoBuilder setSrcGetterDescriptor(String srcGetterDescriptor) {
        this.srcGetterDescriptor = srcGetterDescriptor;
        return this;
    }

    public PropertyDumpInfoBuilder setTargetGetterDescriptor(String targetGetterDescriptor) {
        this.targetGetterDescriptor = targetGetterDescriptor;
        return this;
    }

    public PropertyDumpInfoBuilder setSrcSetterDescriptor(String srcSetterDescriptor) {
        this.srcSetterDescriptor = srcSetterDescriptor;
        return this;
    }

    public PropertyDumpInfoBuilder setTargetSetterDescriptor(String targetSetterDescriptor) {
        this.targetSetterDescriptor = targetSetterDescriptor;
        return this;
    }

    public PropertyDumpInfoBuilder setCollectTypeImpl(Class<?> collectTypeImpl) {
        this.collectTypeImpl = collectTypeImpl;
        return this;
    }

    public PropertyDumpInfoBuilder setSrcKeyType(Class<?> srcKeyType) {
        this.srcKeyType = srcKeyType;
        return this;
    }

    public PropertyDumpInfoBuilder setSrcComponentType(Class<?> srcComponentType) {
        this.srcComponentType = srcComponentType;
        return this;
    }

    public PropertyDumpInfoBuilder setTargetKeyType(Class<?> targetKeyType) {
        this.targetKeyType = targetKeyType;
        return this;
    }

    public PropertyDumpInfoBuilder setTargetComponentType(Class<?> targetComponentType) {
        this.targetComponentType = targetComponentType;
        return this;
    }

    public PropertyDumpInfo createPropertyDumpInfo() {
        return new PropertyDumpInfo(idName, profile, srcOwnerInternalName, targetOwnerInternalName, dumpOverride, attrPathQueryInfo, srcField, targetField, srcFieldInternalName,
                targetFieldInternalName, srcGetterName, targetGetterName, srcSetterName, targetSetterName, srcGetterDescriptor, targetGetterDescriptor, srcSetterDescriptor, targetSetterDescriptor,
                mapFieldOwnerInternalName, mapFieldInternalName, mapFieldGetterName, mapFieldGetterDescriptor, collectTypeImpl, srcKeyType, srcComponentType, targetKeyType, targetComponentType,
                sorted);
    }
}